/**********************************************************************************************/
/* FBL_OsLinux.h	 		                                               					  */
/*                                                                       					  */
/* Copyright Paradigma, 1993-2006															  */
/* All Rights Reserved                                                   					  */
/**********************************************************************************************/

#ifndef __FBL_OsLinux_h
#define __FBL_OsLinux_h

#ifdef FBL_UNIX

#include <sys/times.h>


/**********************************************************************************************/
#define FBL_POSIX_API 1
#define ULLONG_MAX     18446744073709551615ULL
#define LLONG_MAX      9223372036854775807LL

#ifndef NULL
#define NULL 0
#endif // NULL

/**********************************************************************************************/
extern "C"{	


typedef unsigned long       OSType;
typedef unsigned char *     StringPtr;


// GCC do not have stricmp, but it have strcasecmp
#define stricmp strcasecmp 

}


/**********************************************************************************************/
FBL_Begin_Namespace


/**********************************************************************************************/
typedef unsigned long  DWORD;
typedef unsigned short uint16_t;
typedef void *PicHandle;
typedef void *UnixHandle;


//**********************************************************************************************/
//									GLOBAL FUNCTIONS:
//**********************************************************************************************
inline ulong TickCount( void )
{
	tms tm;
	return times(&tm);
}


/**********************************************************************************************/
// This is basic macro for assert in kernel:
//
#ifndef __CHECK
	#define __CHECK 0
#endif

	// Common system-independent and compiler-independent macro FBL_CHECK(x) 
#if __CHECK == 0
	#define CHECK(p) (void(0))
#else
	#define CHECK(p)  { gTotalAssertCount++;\
						if(!(p)) LogAssert(__FILE__,__func__,__LINE__,#p); }
#endif

/**********************************************************************************************/
FBL_End_Namespace


/**********************************************************************************************/
#endif // FBL_UNIX
#endif // __FBL_OsLinux_h
